﻿/* 
    ======================================================================== 
        文 件 名：  Qunaer.cs
        作    者    cgy6094
        创建日期：  2014/3/7 10:59:59
        用    途：  请一定在此描述用途        
        更新记录:    
    ======================================================================== 
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;

namespace TEST
{
	[XmlRoot("root")]
	public class Qunaer
	{
		public Summery summery { get; set; }

		/// <summary>
		/// 签证详情
		/// </summary>
		public List<visadetail> visadetails { get; set; }

		void Test()
		{
			Qunaer qunaer = new Qunaer
			{
				summery = new Summery
				{
					arrive = "澳大利亚",
					status = "12",
					payway = "2",
				},
				visadetails = new List<visadetail> 
				{
					new visadetail
					{
						guarantymoney=1000,
						haveinterview=1,
						type=1,
						profiles=new List<profile>
						{
							new profile
							{
								cate_name="签证",
								cates=new List<cate>
								{
									new cate
									{
										name="测试",
										attchmentinfo="测试",
										description="cgyqu"
									}
								}
							}
						},
						visaprices=new List<visaprice>
								{
									new visaprice
									{
										price=new List<price>
										{
											new price
											{
												title="测试",
												visadescription="临时",
												price_id=12,
												availablecount=12,
												marketprice=12,
												qunarprice=12,
												visadealdays=12
											}
										}
									}
								}
					}
				}

			};
			Console.WriteLine(qunaer.XmlSerialize(removeXsd:true,removeXsi:true));
		}

	}
	public class Summery
	{
		/// <summary>
		/// 产品名称,必填
		/// </summary>
		public string title { get; set; }
		/// <summary>
		/// 产品团号,非必填
		/// </summary>
		public string teamno { get; set; }
		/// <summary>
		/// visa
		/// </summary>
		public string pfunction { get; set; }
		/// <summary>
		/// 对应供应商系统，产品ID,必填
		/// </summary>
		public string resourceid { get; set; }
		/// <summary>
		/// 签证目的地，必填
		/// </summary>
		public string arrive { get; set; }
		/// <summary>
		/// 产品包含签证类型（两项以上以"/"隔开）
		/// 旅游签证/商务签证/探亲访友签证/留学签证/团队签证/其他类型,必填
		/// </summary>
		public string visatypes { get; set; }
		/// <summary>
		/// 付款方式,0-即时付款/1-二次确认，必填
		/// </summary>
		public string payway { get; set; }
		/// <summary>
		/// 办理地点
		/// 全国/北京/上海/广州/成都/沈阳/深圳/武汉，必填，任选其一，只能是这几个地点
		/// </summary>
		public string visadealsplace { get; set; }
		/// <summary>
		/// 受理范围,必填，字数限制，80字以内
		/// </summary>
		public string visadealsdesc { get; set; }
		/// <summary>
		/// 图片链接，多图片用逗号分隔,必填,至少有一张图片，必填
		/// </summary>
		public string image { get; set; }
		/// <summary>
		/// 签证是否包含快递费用 0-包含，1-不包含，快递费统一加收10元，超出部分由供应商额外收取，2-快递到付
		/// </summary>
		public string visaincludeexpress { get; set; }
		/// <summary>
		/// 签证供应商邮寄地址,必填
		/// </summary>
		public string visapostaddress { get; set; }
		/// <summary>
		/// 签证供应商营业时间,必填
		/// </summary>
		public string visabusinesshours { get; set; }
		/// <summary>
		/// 温馨提示
		/// </summary>
		public string tip { get; set; }
		/// <summary>
		/// 退款说明，1-签证产品，用户提交资料给供应商后，签证即开始受理操作，届时如您取消签证服务，无法全额退款且不支持任何变更。;
		/// 2-签证产品，用户提交资料给供应商后，签证即开始受理操作，届时如您取消签证服务，无法全额退款且不支持任何变更；如因使馆拒签，将全额退款。
		/// 3.自定义描述，必填
		/// </summary>
		public string visarefundtype { get; set; }
		/// <summary>
		/// visarefundtype选择了3，需匹配自定义退款描述
		/// </summary>
		public string visaexpressfeedesc { get; set; }
		/// <summary>
		/// {产品状态
		/// </summary>
		public string status { get; set; }
	}

	public class visadetail
	{
		/// <summary>
		/// 1-旅游签证,2-商务签证,3-探亲访友签证,4-留学签证 ,5-工作签证 ,6-其他类型
		/// </summary>
		[XmlAttribute]
		public int type { get; set; }
		/// <summary>
		/// 是否需要保证金,0:否 1：是
		/// </summary>
		[XmlAttribute]
		public int guarantymoney { get; set; }
		/// <summary>
		/// 是否面试，0-没有 1-有
		/// </summary>
		[XmlAttribute]
		public int haveinterview { get; set; }
		public List<profile> profiles { get; set; }
		[XmlElement]
		public List<visaprice> visaprices { get; set; }
	}

	public class profile
	{
		[XmlAttribute]
		public string cate_name { get; set; }
		public List<cate> cates { get; set; }
	}

	public class cate 
	{
		public string name { get; set; }
		public string description { get; set; }
		public string attchmentinfo { get; set; }
	}

	public class visaprice
	{
		[XmlElement]
		public List<price> price { get; set; }
	}

	public class price
	{
		[XmlAttribute]
		public int price_id { get; set; }
		[XmlAttribute]
		public string title { get; set; }
		[XmlAttribute]
		public int availablecount { get; set; }
		[XmlAttribute]
		public int qunarprice { get; set; }
		[XmlAttribute]
		public int marketprice { get; set; }
		[XmlAttribute]
		public int visaentrynum { get; set; }
		[XmlAttribute]
		public int visastaydays { get; set; }
		[XmlAttribute]
		public DateTime visavalidperiod { get; set; }
		[XmlAttribute]
		public int visadealdays { get; set; }
		[XmlAttribute]
		public string visadescription { get; set; }

	}
}
